import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import VueMarkdown from "vue-markdown";
import VueQuillEditor from "vue-quill-editor";
import "@/eleUI";
import "element-ui/lib/theme-chalk/index.css";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import MutationObserver from "mutation-observer";

import VMdEditor from "@kangc/v-md-editor/lib/codemirror-editor";
import "@kangc/v-md-editor/lib/style/codemirror-editor.css";
import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
import "@kangc/v-md-editor/lib/theme/style/github.css";

// highlightjs
import hljs from "highlight.js";

// codemirror 编辑器的相关资源
// Import CodeMirror v5 core and styles
import CodeMirror from "codemirror";
import "codemirror/lib/codemirror.css";

// Import required modes (v5 paths)
import "codemirror/mode/markdown/markdown";
import "codemirror/mode/javascript/javascript";
import "codemirror/mode/css/css";
import "codemirror/mode/htmlmixed/htmlmixed";
import "codemirror/mode/vue/vue";

// Import addons (v5 paths)
import "codemirror/addon/edit/closebrackets";
import "codemirror/addon/edit/closetag";
import "codemirror/addon/edit/matchbrackets";
import "codemirror/addon/display/placeholder";
import "codemirror/addon/selection/active-line";
import "codemirror/addon/scroll/simplescrollbars";
import "codemirror/addon/scroll/simplescrollbars.css";

// iconfont css
import "@/assets/css/iconfont.css";

VMdEditor.Codemirror = CodeMirror;

VMdEditor.use(githubTheme, {
  Hljs: hljs,
});

Vue.use(VMdEditor);
Vue.use(VueMarkdown);
window.MutationObserver = MutationObserver;
Vue.use(VueQuillEditor);

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
